<!DOCTYPE html>
<html>
<head>
	<link rel="stylesheet" href="bootstrap-4.6.2-dist/css/bootstrap.css">
	<script src="js/jquery-3.6.1.js"></script>
	<script src="bootstrap-4.6.2-dist/js/bootstrap.js"></script>
	<meta charset="utf-8" />
	<title></title>
	<script>
		$(function () {
			$.ajax({
				url: "https://localhost:5001/Admin/CustomerInfo/GetCustomerInfoH",
				type: "get",
				data: {
					page: 1,
                    limit: 99999,
					count: true
				},
				success: function (res) {
					$("#custNum").html(res.data.length)
				}
			})

            $.ajax({
                url: "https://localhost:5001/Admin/ProductInfo/GetProductInfo",
                type: "get",
                data: {
                    page: 1,
                    limit: 99999,
                    count: true
                },
                success: function (res) {
                    $("#proNum").html(res.data.length)
                }
			})

            $.ajax({
                url: "https://localhost:5001/Admin/OrderInfo/GetOrderInfoH",
                type: "get",
                data: {
                    page: 1,
                    limit: 99999,
                    count: true
                },
                success: function (res) {
                    $("#orderNum").html(res.data.length)
                }
			})

            $.ajax({
                url: "https://localhost:5001/Admin/UserInfo/GetUserInfo",
                type: "get",
                data: {
                    page: 1,
                    limit: 99999,
                    count: true
                },
                success: function (res) {
					console.log(res)
                    for (var i = 0; i < res.data.length; i++) {
                        $("tbody").append(`
						<tr>
							<td>`+ res.data[i].userName+`</td>
							<td>`+ res.data[i].createTime +`</td>
							<td>`+ res.data[i].departmentName +`</td>
						</tr>
					`)
                    }
                }
            })
		})
	</script>
	<style>
		.justify-content-around {
			background: url("https://bpic.588ku.com/back_our/bg/20201022/bg/4e009dc54df55_433768.jpg") no-repeat 80%;
			background-size: 100%;
			padding: 20px;
		}

		.col-sm-12 {
			color: #fff;
			background: #FF5000;
			border-radius: 10px;
		}

		table{
			width:100%;
			border:1px solid #000000;
		}
	</style>
</head>
<body>
	<div class="container-fluid">
		<div class="row justify-content-around">
			<div class="col-sm-12 col-md-3">
				<p>顾客统计</p>
				<h3 id="custNum">1223</h3>
				<p>当前分类总记录数</p>
			</div>
			<div class="col-sm-12 col-md-3">
				<p>商品统计</p>
				<h3 id="proNum">1223</h3>
				<p>当前分类总记录数</p>
			</div>
			<div class="col-sm-12 col-md-3">
				<p>订单统计</p>
				<h3 id="orderNum">1223</h3>
				<p>当前分类总记录数</p>
			</div>
		</div>

		<div class="row">
			<div class="col-12">
				<table border="1" cellspacing="1" cellpadding="10">
					<thead>
					<th>昵称</th>
					<th>加入时间</th>
					<th>部门</th>
					</thead>
					<tbody>
						
					</tbody>
				</table>
			</div>
		</div>
	</div>
</body>
</html>
